home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Interfaces / CIncludes / stdiostream.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-04  |  1.6 KB  |  75 lines  |  [TEXT/MPS ]

  1. /*
  2.  *------------------------------------------------------------------------
  3.  * Copyright:
  4.  *      © 1993 by Apple Computer Inc.  all rights reserved.
  5.  *
  6.  * Project:
  7.  *      PowerPC C++ Streams Library
  8.  *
  9.  * Filename:
  10.  *      stdiostream.h
  11.  *
  12.  * Created:
  13.  *      (unknown)
  14.  *
  15.  * Modified:
  16.  *      Date     Engineer       Comment
  17.  *      -------- -------------- ------------------------------------------
  18.  *      12/17/93 Rudy Wang      Made this file universal.
  19.  *------------------------------------------------------------------------
  20.  */
  21. #ifndef __STDIOSTREAMH__
  22. #define __STDIOSTREAMH__    1
  23.  
  24. #include <iostream.h>
  25. #include <stdio.h>
  26.  
  27. /*
  28.  * stdiobuf is obsolete, should be avoided!!!
  29.  */
  30. #ifdef powerc
  31. #pragma options align=power
  32. #endif
  33.  
  34. class stdiobuf : public streambuf
  35. {
  36.  
  37. public:
  38.                         stdiobuf(FILE* f);
  39.         FILE*           stdiofile()             { return fp; }
  40.         virtual         ~stdiobuf();
  41.  
  42. public:
  43.         virtual int     overflow(int = EOF);
  44.         virtual int     underflow();
  45.         virtual int     sync();
  46.         virtual streampos seekoff(streamoff, ios::seek_dir, int);
  47.         virtual int     pbackfail(int c);
  48.  
  49. private:
  50.         FILE*           fp;                     
  51.         int             last_op;
  52.         char            buf[2];
  53.  
  54. };  // class stdiobuf
  55.  
  56.  
  57. class stdiostream : public ios
  58. {
  59.  
  60. public:
  61.                         stdiostream(FILE*);
  62.                         ~stdiostream();
  63.         stdiobuf*       rdbuf();
  64.  
  65. private:
  66.         stdiobuf        buf;
  67.  
  68. };  // class stdiostream
  69.  
  70. #ifdef powerc
  71. #pragma options align=reset
  72. #endif
  73.  
  74. #endif
  75.